﻿
<EditForm Model="Product" OnValidSubmit="HandleValidSubmit">

    <DataAnnotationsValidator />
    <ValidationSummary />

    <div class="form-group row">
        <label for="productName" class="col-sm-2 col-form-label">Name: </label>
        <div class="col-sm-10">
            <InputText id="productName" class="form-control" @bind-Value="Product.Name" placeholder="Enter Name"></InputText>
            <ValidationMessage For="@(() => Product.Name)" />
        </div>
    </div>

    <div class="form-group row">
        <label for="code" class="col-sm-2 col-form-label">Code: </label>
        <div class="col-sm-10">
            <InputText id="code" class="form-control" @bind-Value="Product.Code" placeholder="Enter Code"></InputText>
            <ValidationMessage For="@(() => Product.Code)" />
        </div>
    </div>

    <div class="form-group row">
        <label for="description" class="col-sm-2 col-form-label">Description: </label>
        <div class="col-sm-10">
            <InputText id="description" class="form-control" @bind-Value="Product.Description" placeholder="Enter Description"></InputText>
            <ValidationMessage For="@(() => Product.Description)" />
        </div>
    </div>
    <div class="form-group row">
        <label for="description" class="col-sm-2 col-form-label"></label>
        <div class="col-sm-10">
            <button type="submit" class="btn btn-primary">Save</button>
        </div>
    </div>
</EditForm>